import request from '@/utils/request'

export function getMpSetting() {
  return request({
    url: '/shopManage/getMpSetting',
    method: 'get'
  })
}

export function saveMpSetting(data) {
  return request({
    url: '/shopManage/saveMpSetting',
    method: 'post',
    data
  })
}

export function getBasicSetting() {
  return request({
    url: '/shopManage/getBasicSetting',
    method: 'get'
  })
}

export function saveBasicSetting(data) {
  return request({
    url: '/shopManage/saveBasicSetting',
    method: 'post',
    data
  })
}

export function getCompanyDetail() {
  return request({
    url: '/shopManage/getCompanyDetail',
    method: 'get'
  })
}

export function saveCompanyDetail(data) {
  return request({
    url: '/shopManage/saveCompanyDetail',
    method: 'post',
    data
  })
}

export function getAreaList(parentId) {
  if (parentId === undefined || parentId === null) {
    parentId = 0
  }

  return request({
    url: `common/areaList`,
    method: 'get',
    params: { parentId }
  })
}

export function getContactInfo() {
  return request({
    url: '/shopManage/getContactInfo',
    method: 'get'
  })
}

export function saveContactInfo(data) {
  return request({
    url: '/shopManage/saveContactInfo',
    method: 'post',
    data
  })
}

export function getCommissionRatio() {
  return request({
    url: '/shopManage/getCommissionRatio',
    method: 'get'
  })
}

export function saveCommissionRatio(data) {
  return request({
    url: '/shopManage/saveCommissionRatio',
    method: 'post',
    data
  })
}

export function getOtherSetting() {
  return request({
    url: '/shopManage/getOtherSetting',
    method: 'get'
  })
}

export function saveOtherSetting(data) {
  return request({
    url: '/shopManage/saveOtherSetting',
    method: 'post',
    data
  })
}
